﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Runtime.InteropServices.JavaScript.JSType;

namespace ERP.Common.Util.Util.Model;

public class RestResult<T>
{
    private string v1;
    private int v2;
    private object value;

    public RestResult(string msg, int code, T? data)
    {
        Msg = msg;
        Code = code;
        Data = data;
    }

    public string Msg { get; set; }
    public int Code { get; set; }

    public T Data { get; set; }
}

public class RestResultBuilder<T>
{
    public static RestResult<T> Success(T data)
    {
        return new RestResult<T>("", 200, data);
    }

    public static RestResult<T> Success()
    {
        return new RestResult<T>("", 200, default(T));
    }
}
